﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using AutoMapper;
using FwProject.ShoppingMall.Com;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace FwProject.Com.Dto
{
    [AutoMapFrom(typeof(ContentManage))]
    public class ContentManageOutputDto : EntityDto<Guid>
    {
        /// <summary>
        /// 内容类别
        /// </summary>
        [Display(Name = "内容分类")]
        public Guid ContnetTypeId { get; set; }
    
        public ContentTypeOutputDto ContentType { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Display(Name = "标题")]
        [MaxLength(ContentManage.TypeTitleLength, ErrorMessage = "不能超过{1}个字符")]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [Display(Name = "内容")]
        public string Content { get; set; }

        /// <summary>
        /// 访问类别
        /// </summary>
        [Display(Name = "访问类别")]
        public AccessType AccessType { get; set; } = AccessType.Url;

        /// <summary>
        /// 数据（存url 或者 商品ID）
        /// </summary>
        [Display(Name = "数据")]
        public string Data { get; set; }

        public DateTime CreationTime { get; set; }


        /// <summary>
        /// 商品名称
        /// </summary>
        [IgnoreMap]
        public string ShopProductName { get; set; }
    }
}
